from flask import Flask, render_template, jsonify
from handle.analyse import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/geo')
def geo():
    return jsonify(geo_plot_data())


@app.route('/word')
def word():
    return jsonify(word_cloud_data())


@app.route('/funnel')
def funnel():
    return jsonify(funnel_data())


@app.route('/sale_count')
def sale_count():
    return jsonify(sale_count_bar_data())


@app.route('/score')
def score():
    return jsonify(score_desc_bar_data())


@app.route('/pie')
def pie():
    return jsonify(star_pie_data())


if __name__ == '__main__':
    app.run()
